package com.molin.innerClass.test3;

public class TestSwimming {

    public static void main(String[] args) {
        //如果方法问你要的类型是接口，就可以使用匿名类
        //直接将匿名类返回的对象传给goSwimming方法
        goSwimming(new Swimming() {
            @Override
            public void swimm() {
                System.out.println("去游泳吧朋友");
            }
        });
    }
    public static void goSwimming(Swimming swimming){
        swimming.swimm();
    }
}


interface Swimming{
    void swimm();
}
